[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
                            FillPoly procedure

  DECLARATION:  FillPoly(NumPoints : Word; var PolyPoints);

      PURPOSE:  Draws a filled polygon

         UNIT:  Graph

      REMARKS:  PolyPoints is an untyped parameter that contains the
                coordinates of each intersection in the polygon.  NumPoints
                specifies the number of coordinates in PolyPoints.
                A coordinate consists of two words, an X and a Y value.

                The polygon is filled with the current fill style and color.
                The outline is drawn in the current line style and color as
                set by SetLinestyle.

                If an error occurs while filling the polygon, GraphResult
                returns a value of -6 (grNoScanMem).

 RESTRICTIONS:  Must first be in graphics mode.

      EXAMPLE:   Uses
                   Graph;

                Const
                   Triangle: Array(1..3) of PointType =  ((x:  50; y: 100),
                                                          (x: 100; y: 100),
                                                          (x: 150; y: 150));
                Var
                   Gd, Gm : Integer;

                Begin
                   Gd := Detect;
                   InitGraph(Gd, Gm, '');
                   If (GraphResult <> grOK) Then
                      Halt(1);
                   FillPoly(SizeOf(Triangle) div SizeOf(PointType), Pentagon);
                   ReadLn;
                   CloseGraph;
                End.

See Also: DrawPoly GetFillSettings SetFillStyle SetFillPattern
This page created by ng2html v1.05, the Norton guide to HTML conversion utility. Written by Dave Pearson